{extend name='base' }
{block name='content'}
{if $liveList}
<script src="__STATIC__/index/lib/TcPlayer.js" charset="utf-8"></script>
<div id="video" class="video">
</div>
<div class="content">

    {:htmlspecialchars_decode($liveList.live_content)}
</div>
<script>
    var player =  new TcPlayer('video', {
        "m3u8": "{$liveList.live_play_url}",
        "autoplay" : true,      //iOS 下 safari 浏览器，以及大部分移动端浏览器是不开放视频自动播放这个能力的

        "width" :  '1060',//视频的显示宽度，请尽量使用视频分辨率宽度
        "height" : '600'//视频的显示高度，请尽量使用视频分辨率高度
    });
</script>
{/if}
{if !$liveList}
<div class="live">
    <div class="per-video">
        <span>主播还未上线。。。</span>
        <button onclick="liveres({:session('user_id')})">立即预约</button>
    </div>

</div>
<script>
    layui.use('layer', function(){
        var layer = layui.layer;
    });
    function liveres(userid){
        $.post('{:url("index/live/livereserve")}',{id:userid},function (res) {
            if(res.code){
                layer.msg(res.msg,{icon:1});
            }else {
                layer.msg(res.msg,{icon:2});
            }
        })
    }

</script>
{/if}

{/block}
{/extend}
